/*
Total number of pages modified in allocated extents of the file
since last full database backup.
The modified page count can be used to track differential changes in the database
since last full backup to decide if differential backup is beneficial.
*/

-- SQL Server >= 2017
USE <database_name>;
GO

SELECT
	total_page_count AS total_extents,
	modified_extent_page_count AS modified_extents,
	ROUND((CONVERT(FLOAT, modified_extent_page_count) /
		CONVERT(FLOAT, total_page_count)) * 100, 2) AS modified_percent
FROM sys.dm_db_file_space_usage;